<div class="layui-form">
    <script type="text/html" id="toolbarDemo">
        <div class="layui-btn-container">
            {if $addBtn}
            <a class="layui-btn layui-btn-sm" href="{$formUrl}">添加</a>
            {/if}
            {if $delAllBtn}
            <a class="layui-btn layui-btn-sm layui-btn-danger" id="delAll">批量刪除</a>
            {/if}
            {if $returnBtn}
                {if $returnBtn.url}
                    <a class="layui-btn layui-btn-sm layui-btn-warm" onclick="window.location.href='{$returnBtn.url}'">{$returnBtn.title}</a>
                {else}
                    <a class="layui-btn layui-btn-sm layui-btn-warm" onclick="javascript:history.back(-1);">{$returnBtn.title}</a>
                {/if}
            {/if}
            {if $selfBtn}
                {volist name='selfBtn' id='vo'}
                    <a class="layui-btn layui-btn-sm {$vo.class|default=''}" onclick="window.location.href='{$vo.url}'">{$vo.title}</a>
                {/volist}
            {/if}
            {if $confirmBtn}
                {volist name='confirmBtn' id='vo'}
                    <a href="{$vo.url}" class="layui-btn layui-btn-sm {$vo.class|default=''} table-ajax-confirm" data-msg="{$vo.msg|default=''}">{$vo.title}</a>
                {/volist}
            {/if}
            {if $selectDataConfirmBtn}
                {volist name='selectDataConfirmBtn' id='vo'}
                    <a href="{$vo.url}" class="layui-btn layui-btn-sm {$vo.class|default=''} select-data-confirm" data-msg="{$vo.msg|default=''}">{$vo.title}</a>
                {/volist}
            {/if}
            {if $layerBtn}
                {volist name='layerBtn' id='vo'}
                    <a onclick="layerOpen('{$vo.url}', '{$vo.title}', {$vo.area})" class="layui-btn layui-btn-sm {$vo.class|default=''}">{$vo.title}</a>
                {/volist}
            {/if}
            {if $batchLayerBtn}
                {volist name='batchLayerBtn' id='vo'}
                    <a class="layui-btn layui-btn-sm {$vo.class|default=''} batch-{$vo.name}" data-url="{$vo.url}" data-title="{$vo.title}">{$vo.title}</a>
                {/volist}
            {/if}

        </div>
    </script>
    <script type="text/html" id="barTool">
        {notempty name="$formUrl"}
        <a href='{$formUrl}?id={{ d.id }}' class="layui-btn layui-btn-xs">编辑</a>
        {/notempty}

        {notempty name="$listBtn"}
            {volist name="listBtn" id="vo" key="k"}
                <a href='{$vo.url}?id={{ d.id }}' class="layui-btn layui-btn-xs {$vo.class|default=''}">{$vo.title}</a>
            {/volist}
        {/notempty}

        {notempty name="$listLayerBtn"}
            {volist name="listLayerBtn" id="vo" key="k"}
                <a onclick="layerOpen('{$vo.url}?id={{ d.id }}', '{$vo.title}', {$vo.area})" class="layui-btn layui-btn-xs {$vo.class|default=''}">{$vo.title}</a>
            {/volist}
        {/notempty}

        {notempty name="$listConfirmBtn"}
            {volist name="listConfirmBtn" id="vo" key="k"}
                 <a href="{$vo.url}?id={{ d.id }}" class="layui-btn layui-btn-xs {$vo.class|default=''} ajax-confirm" data-msg="{$vo.msg|default=''}" data-repet="{$vo.repet|default=''}" data-remsg="{$vo.repet_msg|default=''}">{$vo.title}</a>
            {/volist}
        {/notempty}

        {notempty name="$fieldSelfBtn"}
            {volist name="fieldSelfBtn" id="vo" key="k"}
                {if $vo.type == 'confirm'}
                 <a href="{$vo.url}?id={{ d.id }}" class="layui-btn layui-btn-xs ajax-confirm {{# if (d.{$vo.field} != {$vo.value}) { }} layui-btn-disabled {{# } }} " data-msg="{$vo.msg|default=''}" data-repet="{$vo.repet|default=''}" data-remsg="{$vo.repet_msg|default=''}">{$vo.title}</a>
                {elseif $vo.type == 'form'}
                 <a {{# if (d.{$vo.field} != {$vo.value}) { }} href='javascript:void(0);' {{# } else { }} href='{$vo.url}?id={{ d.id }}' {{# } }}  class="layui-btn layui-btn-xs {{# if (d.{$vo.field} != {$vo.value}) { }} layui-btn-disabled {{# } }} ">{$vo.title}</a>
                {/if}
            {/volist}
        {/notempty}

        {if $delBtn}
        <a href='javascript:void(0);'
           class="layui-btn layui-btn-danger layui-btn-xs layui-tr-del" data-href="{$delUrl}?id={{ d.id }}&module={$module}&model={$model}">刪除</a>
        {/if}
    </script>

</div>
